package com.xueyi.system.originManager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xueyi.system.originManager.domain.po.OriginManagerPo;
import com.xueyi.system.originManager.domain.query.OriginManagerQuery;
import com.xueyi.system.originManager.domain.dto.OriginManagerDto;
import com.xueyi.system.originManager.mapper.OriginManagerMapper;
import com.xueyi.system.originManager.service.IOriginManagerService;
import com.xueyi.system.originManager.manager.IOriginManagerManager;
import com.xueyi.common.web.entity.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 产地加工管理 服务层处理
 *
 * @author zlf
 */
@Service
public class OriginManagerServiceImpl extends BaseServiceImpl<OriginManagerQuery, OriginManagerDto, IOriginManagerManager> implements IOriginManagerService {


    @Autowired
    private OriginManagerMapper originManagerMapper;

    /**
     * 查询产地加工对象列表 | 数据权限 | 附加数据
     *
     * @param originManager 产地加工对象
     * @return 产地加工对象集合
     */
    @Override
    //@DataScope(userAlias = "createBy", mapperScope = {"OriginManagerMapper"})
    public List<OriginManagerDto> selectListScope(OriginManagerQuery originManager) {
        return baseManager.selectListExtra(originManager);
    }

    @Override
    public List<OriginManagerPo> OriginManagerByList(String id) {

        QueryWrapper<OriginManagerPo> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("harvest_id",id);
        List<OriginManagerPo> originManagerPos = originManagerMapper.selectList(queryWrapper);
        return originManagerPos;
    }
}
